{extend name="public/world"}
{block name="title"}人员分配{/block}
{block name="style"}
<style>
.layui-layout-body {overflow: auto;}
.layui-form-label {width: 100px;}
</style>
{/block}
{block name="container"}
<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
    <div class="layui-card" style="padding: 20px 0 0 0;min-height: 425px;">
        <div class="layui-form-item">
            <label class="layui-form-label label-required">项目启动时间</label>
            <div class="layui-input-inline">
                <input type="text" name="start_at" value="{$pro.start_at}" placeholder="项目启动时间" autocomplete="off" id="laydate-start" lay-key="1" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">预计完成时间</label>
            <div class="layui-input-inline">
                <input type="text" name="end_at" value="{$pro.end_at}" placeholder="预计完成时间" autocomplete="off" id="laydate-end" lay-key="2" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required" style="width: 518px;text-align: left;padding-left: 27px;">注：只有设置了项目负责人并且设置项目启动时间后，该项目才正式启动</label>
        </div>
        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-front-submit" id="LAY-front-submit" value="确认">
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    //JavaScript代码区域
    layui.use(['form','laydate'], function() {
        var $ = layui.$
            , laydate = layui.laydate
            , form = layui.form;
        //开始日期
        var insStart = laydate.render({
            elem: '#laydate-start'
            ,min: '2020-01-01'
            ,type: 'date'
            //,value: new Date()
            ,done: function(value, date){
                //更新结束日期的最小日期
                insEnd.config.min = lay.extend({}, date, {
                    month: date.month - 1
                });
                //自动弹出结束日期的选择器
                insEnd.config.elem[0].focus();
            }
        });

        //结束日期
        var insEnd = laydate.render({
            elem: '#laydate-end'
            ,min: '2020-01-01'
            ,type: 'date'
            ,done: function(value, date){
                //更新开始日期的最大日期
                insStart.config.max = lay.extend({}, date, {
                    month: date.month - 1
                });
            }
        });
    });
</script>
{/block}